<?php

namespace App\Services\Strator;

use App\Models\Strator\Strator;
use App\Models\Strator\StratorHasPosition;
use Illuminate\Support\Collection;

class StratorService
{

    //
    public function getAuthStratorIds($strator):Collection{
        if($strator->is_super==1){
            return Strator::pluck('id');
        }
        $positionService = new StratorPositionService();
        $position_ids = $positionService->getAuthPositionIds($strator);
        return StratorHasPosition::whereIn('position_id',$position_ids)->pluck('strator_id');
    }


}
